import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'index',
    redirect: "login"
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home'),
    children: [{
        path: '/dept',
        name: 'dept',
        component: () => import('../views/dept')
      },
      {
        path: '/users',
        name: 'users',
        component: () => import('../views/user')
      }
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router